def demo(num, num_list):
    num += num
    num_list += num_list
    print(num)
    print(num_list)


gl_num = 10

gl_list = [1, 2]
demo(gl_num, gl_list)

print(gl_num)
# 此时是[1,2,1,2]
# 列表变量执行加等于不是先＋再赋值的操作，本质上是调用列表的extend方法
print(gl_list)
